import Vue from 'vue'
import Router from 'vue-router'
/* 1 导入hello组件 */
import Hello from '../components/Hello.vue'
/* 2 第二种导入hello组件方式 */
import Login from "@/components/Login"
import error from '../components/404.vue'
/* 引进exam目录下的login组件 */
import login from '../components/exam/login.vue'
Vue.use(Router)
import index from '../components/exam/index.vue'
import question from '../components/exam/question.vue'
import showPaper from '../components/exam/showPaper.vue'
import paperAdd from '../components/exam/PaperAdd.vue'
import sexam from "../components/exam/exam.vue"
import shouye from "../components/exam/shouye.vue"
import approval from "../components/exam/approval.vue"
import timeManage from "../components/exam/timeManage.vue"
import department from "../components/exam/Department.vue"

export default new Router({
  mode: 'history',
  routes: [
    {
      path: '*',//通配所有的错误地址
      name: 'error',//描述路径的名称，一般name是唯一的
      component: error//引入组件
    },
    {
      path: '/hello',//浏览器访问路径
      name: 'Hello',//描述路径的名称，一般name是唯一的
      component: Hello//引入组件
    },
    {
      path: '/',//设置斜杠表示默认启动页面
      name: 'login',
      component: login
    },
   
    {
      path: '/index',//设置斜杠表示默认启动页面
      name: 'index',
      redirect:"/index/shouye",//默认重定向页面
      meta:{'isLogin':true},
      component: index,
      children:[
          {
                  path:"question",
                  name:"question",
                  component:question
                },
                {
                  path:"paperAdd",//设置斜杠表示默认启动页面
                  name:"paperAdd",
                  component:paperAdd
                },
                {
                  path:"shouye",//设置斜杠表示默认启动页面
                  name:"shouye",
                  component:shouye
                },
                {
                  path:"showPaper",//设置斜杠表示默认启动页面
                  name:"showPaper",
                  component:showPaper
                },
                {
                  path:"sexam",
                  name:"sexam",
                  component:sexam
                },
                {
                  path:"approval",
                  name:"approval",
                  component:approval
                },
                {
                  path:"timeManage",
                  name:"timeManage",
                  component:timeManage
                },
                {
                  path:"department",
                  name:"department",
                  component:department
                }
      ]
    },
    // {
    //   path: '/question',//设置斜杠表示默认启动页面
    //   name: 'question',
    //   component: question
    // },
    // {
    //       path:"/paperAdd",//设置斜杠表示默认启动页面
    //       name:"paperAdd",
    //       component:paperAdd
    // },
    // {
    //   path: '/showPaper',//设置斜杠表示默认启动页面
    //   name: 'showPaper',
    //   component: showPaper
    // }
  ]
})
